import{
  SETSTOR,
  SETSTORS,
  REMOVESTOR,
  UPDATEID,
  USERLOGIN,
  ADDINDEXDATA,
  SETREPLACED,
  SETLOADING,
  SETARTICLES,
  SETUSERINFO
} from '@/store/mutation-type.js'

import { setStore,removeStore,setStores} from '@/config/mUtils.js'

export default{
  [SETSTOR](state,info){
    setStore(info);
    state.userId=info;
  },[SETSTORS](state,info){
    setStores(info);
    state.userId=info;
  },
  [REMOVESTOR](state){
    removeStore();
  },
  [UPDATEID](state,info){
    state.updateId =info;
  },
  [USERLOGIN](state,info){
    state.userLogin=info;
  },
  [ADDINDEXDATA](state,info){
    state.indexData = info;
    state.indexTotal=Math.ceil(info.length/5)*10;
  },
  [SETREPLACED](state,info){
    state.replace =info;
  },
  [SETLOADING](state,info){
    state.loading=info;
  },
  [SETARTICLES](state,info){
    state.aritcle=info;
  },
  [SETUSERINFO](state,info){
    state.userInfo=info;
  }
}